home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / sgverinf / FOLDER_V.HTT < prev    next >
Encoding:
Text File  |  1998-07-29  |  14.0 KB  |  415 lines

  1. <!-- 
  2.  * This file was automatically generated by Microsoft Internet Explorer 4.0 
  3.  * using the file %THISDIRPATH%\folder.htt (if customized) or
  4.  * %TEMPLATEDIR%\folder.htt (if not customized).
  5.  -->
  6.  
  7. <html>
  8.     <style>
  9.         body        {font: 8pt/10pt verdana; margin: 0}
  10.         #Banner        {position: absolute; width: 100%; height: 88px; background: URL(res://webvw.dll/folder.gif) no-repeat top left}
  11.         #MiniBanner    {position: absolute; width: 100%; height: 32px; background: window}
  12.         #Icon        {position: absolute; left: 11px; top: 12px; width: 64px; height: 64px}
  13.         #FileList    {position: absolute; left: 30%; top: 88px; width: 1px; height: 1px}
  14.         #Media        {margin-left: 20px; margin-top: 10px}
  15.         #Panel        {position: absolute; top: 88px; width: 30%; background: window; overflow: auto}
  16.         #PieChart    {width: 100px; height: 50px; margin-top: 10px}
  17.         #Thumbnail    {width: 160px; height: 160px; margin-top: 0px}
  18.         #Status        {margin-left: 20px}
  19.         p        {margin-left: 20px; margin-right: 8px}
  20.         p.Title        {font: 16pt/16pt verdana; font-weight: bold; color: #0099FF}
  21.         p.Warning    {font-weight: bold; color: red}
  22.         p.Links        {margin-top: 4px}
  23.         a:link        {color: #FF6633}
  24.         a:visited    {color: #0099FF}
  25.         a:active     {color: black}
  26.         td              {font: 8pt/10pt verdana;}
  27.     </style>
  28.  
  29.     <head>
  30.         <!-- allow references to any resources you might add to the folder -->
  31.         <!-- (a "webbot" is a special wrapper for FrontPage compatibility) -->
  32.         <!-- webbot bot="HTMLMarkup" tag="base" startspan -->
  33.         <base href="%THISDIRPATH%\">
  34.         <!-- webbot bot="HTMLMarkup" endspan -->
  35.  
  36.         <script LANGUAGE="JavaScript">
  37.             // Error handling
  38.             function errortrap(msg, url, line)
  39.             {
  40.                document.all("VerInfo").style.display = "none";
  41.                return true;
  42.             }
  43.             onerror=errortrap;
  44.             
  45.            // Create SGVersionInfo object
  46.            var VerInfo = new ActiveXObject("sgVersionInfo.VersionInfo");
  47.             
  48.             function ShowVerInfo(sFileName)
  49.             {
  50.                document.all("VerInfoData").innerHTML = "<p> </p>";
  51.             
  52.                // Retrieve version info
  53.                VerInfo.Path = sFileName;
  54.                var sData = "";
  55.                if (VerInfo.InfoExist)
  56.                {
  57.                         sData = sData + "File Ver.: "    + VerInfo.FileVersion + "<br>";
  58.                         sData = sData + "Product Ver.: " + VerInfo.ProductVersion + "<br>";
  59.                         sData = sData + "OS: "           + VerInfo.FileOSString + "<br>";
  60.                         sData = sData + "Product: "      + VerInfo.ProductName + "<br>";
  61.                         sData = sData + "Language: "     + VerInfo.LanguageName + "<br>";
  62.                         sData = sData + "Company: "      + VerInfo.CompanyName + "<br>";
  63.                         sData = sData + "Comments: "     + VerInfo.Comments + "<br>";
  64.                         
  65.                        // Show version info
  66.                        document.all("VerInfo").style.display = "inline";
  67.                        document.all("VerInfoData").innerHTML = sData;
  68.                }
  69.                else
  70.                {
  71.                    // Hide version info
  72.                   sData = "";
  73.                    document.all("VerInfo").style.display = "none";
  74.                }
  75.             }
  76.         </script>
  77.         
  78.         <script language="JavaScript">
  79.             var L_Intro_Text    = "Select an icon to view its description.";
  80.             var L_Multiple_Text    = " objects selected.";
  81.             var L_Size_Text        = "Size: ";
  82.             var L_FileSize_Text    = "Total File Size: ";
  83.             var L_Delimiter_Text    = ",";
  84.             var L_Bytes_Text    = " bytes";
  85.             var L_Attributes_Text    = "Attributes";
  86.             var L_Codes_Text    = "RHSACE";
  87.             var L_ReadOnly_Text     = "Read-only";
  88.             var L_Hidden_Text    = "Hidden";
  89.             var L_System_Text    = "System";
  90.             var L_Archive_Text    = "Archive";
  91.             var L_Compressed_Text    = "Compressed";
  92.             var L_Encrypted_Text    = "Encrypted";
  93.             var L_NoAttributes_Text = "(none set)";
  94.             var timer        = 0;
  95.             var wantMedia        = false; // cool, but may hinder media file manipulation
  96.  
  97.             function FixSize() {
  98.                 // this function handles fixed panel sizing and collapsing when the window resizes
  99.                 var hideTop    = 200;
  100.                 var hideLeft    = 400;
  101.                 var miniHeight    = 32;
  102.                 var ch        = document.body.clientHeight;
  103.                 var cw        = document.body.clientWidth;
  104.  
  105.                 if (hideTop > ch) {
  106.                     document.all.Banner.style.visibility = "hidden";
  107.                     document.all.MiniBanner.style.visibility = "visible";
  108.                     document.all.FileList.style.top = miniHeight;
  109.                     document.all.Panel.style.top = miniHeight;
  110.                 } else {
  111.                     document.all.Banner.style.visibility = "visible";
  112.                     document.all.MiniBanner.style.visibility = "hidden";
  113.                     document.all.FileList.style.top = (document.all.Banner.offsetHeight - 32) + "px";
  114.                     document.all.Panel.style.top = (document.all.Banner.offsetHeight) + "px";
  115.                     document.all.Rule.style.width = (cw > 84 ? cw - 84 : 0) + "px";      
  116.                 }
  117.                 if (hideLeft > cw) {
  118.                     document.all.Panel.style.visibility = "hidden";
  119.                     document.all.FileList.style.pixelLeft = 0;
  120.                     document.all.FileList.style.pixelTop = document.all.Panel.style.pixelTop;
  121.                 } else {
  122.                     document.all.Panel.style.visibility = "visible";
  123.                     document.all.FileList.style.pixelLeft = document.all.Panel.style.pixelWidth;
  124.                 }
  125.                 document.all.FileList.style.pixelWidth = cw - document.all.FileList.style.pixelLeft;
  126.                 document.all.FileList.style.pixelHeight = ch - document.all.FileList.style.pixelTop;
  127.                 document.all.Panel.style.pixelHeight = ch - document.all.Panel.style.pixelTop;
  128.             }
  129.  
  130.             function FormatNumber(n) {
  131.                 var t = "";
  132.                 var i, j = 0;
  133.                 for (i = n.length - 1; i >= 0; i--) {
  134.                     t = n.charAt(i) + t;
  135.                     if (i && ((++j % 3) == 0))
  136.                         t = L_Delimiter_Text + t;
  137.                 }
  138.                 return t;
  139.             }
  140.  
  141.             function Init() {
  142.                 // call our FixSize() function whenever the window gets resized
  143.                 window.onresize = FixSize;
  144.                 FixSize();
  145.                 Info.innerHTML = L_Intro_Text;
  146.                 ShowVerInfo();
  147.             }
  148.         </script>
  149.  
  150.         <script language="JavaScript" for="FileList" event="SelectionChanged">
  151.             // this script updates the left info Panel when you select icons
  152.             var items    = FileList.FocusedItem;
  153.             var fldr    = FileList.Folder;
  154.             var name;
  155.             var data;
  156.             var text;
  157.             var title;
  158.             var size = 0;
  159.             var i;
  160.  
  161.             // cancel any pending status message
  162.             if (timer) {
  163.                 window.clearTimeout(timer);
  164.                 timer = 0;
  165.             }
  166.  
  167.             // erase any visible thumbnail since the selection changed
  168.             document.all.Thumbnail.style.display = "none";
  169.             document.all.Status.style.display = "none";
  170.  
  171.             // stop & destroy any media player
  172.             if (wantMedia)
  173.                 document.all.Media.innerHTML = "";
  174.  
  175.             data = FileList.SelectedItems().Count;
  176.             if (data == 0) {
  177.                 // nothing selected?
  178.                 Info.innerHTML = L_Intro_Text;
  179.                 return;
  180.             }
  181.             else if (data > 1) {
  182.                 // more than one item selected?
  183.                 text = data + L_Multiple_Text + "<br>";
  184.                 if (data <= 100) {
  185.                     for (i = 0; i < data; i++)
  186.                         size += FileList.SelectedItems().Item(i).Size;
  187.                     if (size)
  188.                         text += "<br>" + L_FileSize_Text + FormatNumber(size.toString()) + L_Bytes_Text + "<br>";
  189.                     if (data <= 16)
  190.                         for (i = 0; i < data; i++)
  191.                             text += "<br>" + FileList.SelectedItems().Item(i).Name;
  192.                 }
  193.                 Info.innerHTML = text;
  194.                 return;
  195.             }
  196.  
  197.             // name
  198.             name = fldr.GetDetailsOf(items, 0);
  199.             text = "<b>" + name + "</b>";
  200.  
  201.             // type
  202.             data = fldr.GetDetailsOf(items, 2);
  203.             if (data)
  204.                 text += "<br>" + data;
  205.  
  206.             // date
  207.             data = fldr.GetDetailsOf(items, 3);
  208.             if (data)
  209.                 text += "<br><br>" + fldr.GetDetailsOf(null, 3) + ":<br>" + data;
  210.  
  211.             // size?
  212.             size = FileList.SelectedItems().Item(0).Size;
  213.             if (size)
  214.                 if (size < 1000)
  215.                     text += "<br><br>" + L_Size_Text + size + L_Bytes_Text;
  216.                 else {
  217.                     data = fldr.GetDetailsOf(items, 1);
  218.                     if (data)
  219.                         text += "<br><br>" + fldr.GetDetailsOf(null, 1) + ": " + data;
  220.                     else
  221.                         text += "<br><br>" + L_Size_Text + FormatNumber(size.toString()) + L_Bytes_Text;
  222.                 }
  223.  
  224.             // extra details?
  225.             for (i = 4; i < 10; i++) {
  226.                 title = fldr.GetDetailsOf(null, i);
  227.                 if (!title)
  228.                     break;
  229.                 data = fldr.GetDetailsOf(items, i);
  230.                 if (title == L_Attributes_Text) {
  231.                     var code;
  232.                     var s = "";
  233.  
  234.                     text += "<br><br>" + title + ": ";
  235.                     for (i = 0; i < 6; i++) {
  236.                         code = L_Codes_Text.charAt(i);
  237.                         if (data.indexOf(code) > -1) {
  238.                             if (s)
  239.                                 s += ", ";
  240.                             if (i == 0)
  241.                                 s += L_ReadOnly_Text;
  242.                             else if (i == 1)
  243.                                 s += L_Hidden_Text;
  244.                             else if (i == 2)
  245.                                 s += L_System_Text;
  246.                             else if (i == 3)
  247.                                 s += L_Archive_Text;
  248.                             else if (i == 4)
  249.                                 s += L_Compressed_Text;
  250.                             else if (i == 5)
  251.                                 s += L_Encrypted_Text;
  252.                         }
  253.                     }
  254.                     if (!s)
  255.                         s = L_NoAttributes_Text;
  256.                     text += s;
  257.                 }
  258.                 else if (data)
  259.                     text += "<br><br>" + title + ":<br>" + data;
  260.             }
  261.  
  262.             // tip?
  263.             data = fldr.GetDetailsOf(items, -1);
  264.             if (data && data != name) {
  265.                 var start;
  266.                 var end;
  267.                 var theLink;
  268.                 var a;
  269.  
  270.                 // parse lines for Office files without breaking links below
  271.                 a = data.split("\n");
  272.                 data = a.join("<br>\n");
  273.  
  274.                 // look for embedded links
  275.                 text += "<br><br>";
  276.                 start = data.indexOf("http://");
  277.                 if (start < 0)
  278.                     start = data.indexOf("file://");
  279.                 if (start < 0)
  280.                     text += data;
  281.                 else {
  282.                     end = data.indexOf(" ", start);
  283.                     if (end < 0)
  284.                         end = data.length;
  285.                     if (start > 0)
  286.                         text += data.substring(0, start - 1);
  287.                     theLink = data.substring(start, end);
  288.                     text += theLink.link(theLink);
  289.                     if (end < data.length)
  290.                         text += data.substring(end + 1, data.length);
  291.                 }
  292.             }
  293.  
  294.             // replace Info with the new text
  295.             Info.innerHTML = text;
  296.  
  297.             // SG VersionInfo fldr
  298.             ShowVerInfo(items.Path);
  299.             
  300.             if (wantMedia) {
  301.                 // show media preview or thumbnail based on file extension
  302.                 var ext = name.substring(name.lastIndexOf(".") + 1, name.length);
  303.                 ext = ext.toLowerCase();        
  304.                 if (ext == 'avi' || ext == 'mov' || ext == 'mpe' || ext == 'mpeg' || ext == 'mpg') {
  305.                     // show a movie player
  306.                     document.all.Media.innerHTML = '<object id="Player" style="width: 160px; height: 148px" classid=clsid:05589FA1-C356-11CE-BF01-00AA0055595A><param name="FileName" value="' + items.Path + '"><param name=ShowDisplay value=0><param name=BorderStyle value=0></object>'
  307.                     return;
  308.                 } else if (ext == 'aif' || ext == 'aifc' || ext == 'aiff' || ext == 'au' || ext == 'mid' || ext == 'rmi' || ext == 'snd' || ext == 'wav') {
  309.                     // show a sound player
  310.                     document.all.Media.innerHTML = '<object id="Player" style="width: 160px; height: 28px" classid=clsid:05589FA1-C356-11CE-BF01-00AA0055595A><param name="FileName" value="' + items.Path + '"><param name=ShowDisplay value=0></object>'
  311.                     return;
  312.                 }
  313.             }
  314.  
  315.             // try to generate a new thumbnail asynchronously, and delay the status message one second
  316.             if (Thumbnail.displayFile(items.Path))
  317.                 timer = window.setTimeout('document.all.Status.style.display = ""', 1000);
  318.         </script>
  319.  
  320.         <script language="JavaScript" for="Thumbnail" event="OnThumbnailReady">
  321.             // when a valid thumbnail has been generated, display it
  322.             window.clearTimeout(timer);
  323.             timer = 0;
  324.             document.all.Status.style.display = "none";
  325.             if (document.all.Thumbnail.haveThumbnail() && document.all.Media.innerHTML == "")
  326.                 document.all.Thumbnail.style.display = "";
  327.         </script>
  328.  
  329.     </head>
  330.  
  331.     <body scroll=no onload="Init()">
  332.  
  333.         <!-- start normal banner -->
  334.         <div id="Banner" style="visibility: hidden">
  335.             <!-- using a table with nowrap to prevent word wrapping -->
  336.             <table><tr><td nowrap>
  337.                 <p class=Title style="margin-left: 104px; margin-top: 16px">
  338.                 <!--webbot bot="HTMLMarkup" startspan alt="<B><I>Web View Folder Title</I></B> " -->
  339.                 %THISDIRNAME%
  340.                 <!--webbot bot="HTMLMarkup" endspan -->
  341.             </td></tr></table>
  342.             <!-- this is more efficient than a long graphic, but we have to adjust it in FixSize() -->
  343.             <hr id="Rule" size=1px color=black style="position: absolute; top: 44px; left: 84px">
  344.             <!-- this is our awesome icon extractor -->
  345.             <object id=Icon classid="clsid:E5DF9D10-3B52-11D1-83E8-00A0C90DC849">
  346.                 <param name="scale" value=200>
  347.             </object>
  348.         </div>
  349.         <!-- end normal banner -->
  350.  
  351.         <!-- start mini banner -->
  352.         <div id="MiniBanner" style="visibility: hidden">
  353.             <!-- using a table with nowrap to prevent word wrapping -->
  354.             <table><tr><td nowrap>
  355.                 <p class=Title style="margin-left: 16px; margin-top: 4px">
  356.                 <!--webbot bot="HTMLMarkup" startspan alt="<B><I>Web View Folder Title</I></B> " -->
  357.                 %THISDIRNAME%
  358.                 <!--webbot bot="HTMLMarkup" endspan -->
  359.             </td></tr></table>
  360.         </div>
  361.         <!-- end mini banner -->
  362.  
  363.         <!-- start left info panel -->
  364.         <div id="Panel">
  365.             <p style="margin-top: 16px");
  366.             <span id="Info"></span>
  367.         
  368.             <!-- start of SG VersionInfo data -->
  369.             <p>
  370.             <div id="VerInfo" style="margin-left: 18px;">
  371.                 <table width="90%">
  372.                     <tr><td width="100%" style="border-bottom:1px solid #0099FF; color:#0099FF;">
  373.                         <b>SG Version Info:</b>
  374.                     </td></tr>
  375.                     <tr><td width="100%" style="border-bottom:1px solid #0099FF;">
  376.                         <div id="VerInfoData"></div>
  377.                     </td></tr>
  378.                 </table>
  379.             </div>
  380.             <!-- end of SG VersionInfo data -->
  381.             <!-- HERE'S A GOOD PLACE TO ADD A FEW LINKS OF YOUR OWN -->
  382.             <!-- (examples commented out)
  383.             <p>
  384.             <a href="http://www.mylink1.com/">Custom Link 1</a>
  385.             <p class=Links>
  386.             <a href="http://www.mylink2.com/">Custom Link 2</a>
  387.             -->
  388.  
  389.             <p>
  390.             <!-- this is the thumbnail viewer control -->
  391.             <object id=Thumbnail classid="clsid:1D2B4F40-1F10-11D1-9E88-00C04FDCAB92" style="display: none">
  392.             </object>
  393.  
  394.             <!-- this is the status message that pops up during thumbnail generation -->
  395.             <div id="Status" style="display: none">
  396.                 Generating thumbnail...
  397.             </div>
  398.  
  399.             <!-- this contains the ActiveMovie control for later instantiation -->
  400.             <div id="Media">
  401.             </div>
  402.             
  403.         </div>
  404.         <!-- end left info panel -->
  405.  
  406.         <!-- this is the standard file list control -->
  407.         <!-- webbot bot="HTMLMarkup" startspan u-src="file:///C:\Program Files\Microsoft FrontPage Express\Data\FoldData.gif" -->
  408.         <object id="FileList" border=0 tabindex=1 classid="clsid:1820FED0-473E-11D0-A96C-00C04FD705A2"
  409.         </object>
  410.         <!-- webbot bot="HTMLMarkup" endspan -->
  411.  
  412.     </body>
  413. </html>
  414.  
  415.